//
//  RootTabBarView.m
//  mintHome
//
//  Created by 朱彦名 on 16/6/15.
//  Copyright © 2016年 朱彦名. All rights reserved.
//

#import "RootTabBarView.h"
#import "ViewController.h"
#import "singlePage.h"
#import "classifyView.h"
#import "myloginPage.h"
#import "navigitionController.h"
#import "layoutSinglePage.h"

@interface RootTabBarView ()


@end

@implementation RootTabBarView

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{
    self = [super initWithNibName: nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        self.viewControllers = [self creatRootVCs];
    }
    return self;
}
- (NSArray <UIViewController *>*)creatRootVCs{

    
    NSMutableArray *arrOfVCs = [NSMutableArray array];
    
    
    
    //minthome页面
    ViewController *vc = [[ViewController alloc]init];
    navigitionController *mintHomeNavi = [[navigitionController alloc]initWithRootViewController:vc];
    [arrOfVCs addObject:mintHomeNavi];
    [vc release];
    mintHomeNavi.tabBarItem = [[[UITabBarItem alloc]initWithTitle:@"薄荷家居" image:[UIImage imageNamed:@"fangzi.png"] tag:200]autorelease];
    [mintHomeNavi release];
    
 
    //singlePage页面
    singlePage *single = [[singlePage alloc]init];
    navigitionController *singleNavi = [[navigitionController alloc]initWithRootViewController:single];
    [arrOfVCs addObject:singleNavi];
    [single release];
    
    
    singleNavi.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"单品" image:[UIImage imageNamed:@"danpin"] tag:200];
    
    
    
    

    
    //classify页面
    classifyView *classify = [[classifyView alloc]init];
    
    navigitionController *classifyNavi = [[navigitionController alloc]initWithRootViewController:classify];
    [arrOfVCs addObject:classifyNavi];
    [classify release];
    classifyNavi.tabBarItem = [[[UITabBarItem alloc]initWithTitle:@"分类" image:[UIImage imageNamed:@"fenlei"] tag:300]autorelease];
    [classifyNavi release];
    
    //mylogin页面
    myloginPage *login = [[myloginPage alloc]init];
    navigitionController *loginNavi = [[navigitionController alloc]initWithRootViewController:login];
    
    [arrOfVCs addObject:loginNavi];
    loginNavi.tabBarItem = [[[UITabBarItem alloc]initWithTitle:@"我" image:[UIImage imageNamed:@"wo"] tag:400]autorelease];
    [loginNavi release];
    
    
    
    
    
    
    
    
    return arrOfVCs;
    
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
